package com.example;

public class MyClass {
    private static ThreadLocal<String> mThreadLocal = new ThreadLocal<>();

    public static void main(String... args) {
        mThreadLocal.set("main");
        new Thread(new Runnable() {
            @Override
            public void run() {
                mThreadLocal.set(Thread.currentThread().getName());
                System.out.print(mThreadLocal.get());
            }
        }).start();

        System.out.print(mThreadLocal.get());

    }


}
